<?php

/**
 * @package urCronPlugin
 * @subpackage Test
 * @version $Id: bootstrap.php 5 2009-06-09 09:15:55Z flambeur $
 * @author Marc Weistroff <marc.weistroff@gmail.com>
 * Part of the code taken from Fabien Potencier <fabien.potencier@symfony-project.com>
 */
if (!isset($_SERVER['SYMFONY']))
{
  die("You must set the \"SYMFONY\" environment variable to the symfony lib dir (export SYMFONY=/path/to/symfony/lib/).\n");
}

require_once(dirname(__FILE__).'/../../../config/ProjectConfiguration.class.php');
require_once $_SERVER['SYMFONY'].'/vendor/lime/lime.php';
require_once $_SERVER['SYMFONY'].'/autoload/sfCoreAutoload.class.php';
sfCoreAutoload::register();

$configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'test', true);
new sfDatabaseManager($configuration);
sfContext::createInstance($configuration);

function clear_database()
{
  Doctrine::getTable('urCronItemData')->findAll()->delete();
  Doctrine::getTable('urCronItemTag')->findAll()->delete();
  Doctrine::getTable('urCronItem')->findAll()->delete();
  Doctrine::getTable('urCronFeed')->findAll()->delete();
  Doctrine::getTable('urCronData')->findAll()->delete();
  Doctrine::getTable('urCronTag')->findAll()->delete();  
}